package com.mc.code.mapper;

import com.mc.code.entity.CodeItems;
import com.mc.code.entity.ItemStage;
import com.mc.code.entity.Stage;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface StageMapper {
    List<CodeItems> partakeItems(@Param("userNo") String userNo,@Param("currentPage") int currentPage, @Param("pageCount") int pageCount);

    void insertItemStage(@Param("itemNo") Integer itemNo,@Param("partakeNo") String partakeNo);

//    填入划分以后的阶段详情，为待需求方查看
    void divideInsertStage(@Param("i")int i ,@Param("userNo") String userNo,@Param("itemNo") int itemNo,@Param("num") int stageNum,
                           @Param("name") String stageName,@Param("date") String stageDate,@Param("money") double stageMoney,@Param("explain") String stageExplain);

    void updateStageCondition(@Param("itemNo") int itemNo,@Param("userNo") String userNo);

    int selectStageCondition(Integer itemNo);

    List<Stage> stageDetail(@Param("partakeNo") Integer partakeNo,@Param("itemNo") Integer itemNo);

    List<ItemStage> itemStage(Integer itemNo);

    void StageCondition(@Param("userNo") String userNo,@Param("itemNo") Integer itemNo,@Param("stageCondition") Integer stageCondition);

    void stageDetailAgree(@Param("itemNo") Integer itemNo,@Param("partakeNo") String partakeNo);

    int stageNum(@Param("itemNo") Integer itemNo,@Param("partakeNo") String partakeNo);

    void stageGeneral(@Param("itemNo") Integer itemNo,@Param("partakeNo") String partakeNo,@Param("i") int i);

    List<Stage> stageDetailStart(@Param("userNo") String userNo,@Param("itemNo") Integer itemNo);

    int stageCurrent(@Param("itemNo") Integer itemNo,@Param("userNo") String userNo);

    void updateStageCurrent(@Param("partakeNo") String partakeNo,@Param("stageNum") Integer stageNum,@Param("itemNo") Integer itemNo);

    int stageNow(@Param("itemNo") Integer itemNo,@Param("userNo") String userNo);

    void uploadStageFile(@Param("filename") String filename,@Param("itemNo") Integer itemNo,@Param("partakeNo") String partakeNo,@Param("stageNum") Integer stageNum);

    List<ItemStage> itemStartStage(Integer itemNo);

    String downLoadStageFile(@Param("itemNo") Integer itemNo,@Param("partakeNo") String partakeNo,@Param("stageNow") int stageNow);

    void ApplyStageCurrent(@Param("itemNo") Integer itemNo,@Param("partakeNo") String partakeNo,@Param("checkValue") Integer checkValue);

    void ApplyStageNow(@Param("itemNo") Integer itemNo,@Param("partakeNo") String partakeNo,@Param("checkValue") Integer checkValue);

    void payPartakeNo(@Param("money") double money,@Param("userNo") String partakeNo);

    void finishItem(Integer itemNo);

    String stageStart(Integer itemNo);

    int stageConditiondivision(@Param("itemNo") Integer itemNo,@Param("userNo") String userNo);

    void returnStage(@Param("itemNo") Integer itemNo,@Param("partakeNo") String partakeNo,@Param("current") Integer current,@Param("now") Integer now);

    Integer getMyPartakeTotalPage(String userNo);
}
